/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author TQNINH
 */
//Way 2
public class MyThreadRun implements Runnable{
    
    public MyThreadRun(){
        
    }
    
    public void run(){
        Thread th = Thread.currentThread();
        String name = th.getName();
        for(int i = 0;i < 5;i++){
            System.out.println((i + 1) + " - Hello " + name);
            
            try{
                Thread.sleep(1000);
            }catch(InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
